package lwf.web.struts.action.hangman;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import lwf.db.manager.HangmanManager;
import lwf.handler.IProcessHandler;
import lwf.web.struts.action.BaseAction;
import lwf.web.struts.action.form.hangman.HangmanActionForm;

import net.lwf.web.constant.IPageTitle;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;


public class HangmanAction extends BaseAction {
	
	public ActionForward home(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		HangmanActionForm hmaform = (HangmanActionForm) form;
		hmaform.setData(new HangmanManager().getData());
		return mapping.findForward("home");
	} //home
	
	public ActionForward refresh(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		HangmanActionForm hmaform = (HangmanActionForm) form;
		hmaform.setData(new HangmanManager().getData());
		return mapping.findForward("home");
	} //home

	@Override
	public IProcessHandler getHandler(HttpServletRequest request) {
		return null;
	}

	@Override
	public String getPageTitle() {
		return IPageTitle.HANGMAN;
	}

	@Override
	public String getMainTitle() {
		return "Games";
	}

	@Override
	public String getPdfLink() {
		return null;
	}

	@Override
	public String getQuizLink() {
		return null;
	}

} //HangmanAction
